package com.tkc.converter;

import java.util.ArrayList;
import java.util.List;

import com.tkc.common.util.TimeHelperUtil;
import com.tkc.dao.model.doo.TeacherDOO;
import com.tkc.service.model.info.TeacherInfo;

/**
 * 
 * @Function: 用于dao层到service层对象数据的转换
 * 
 * @Project :assessmenttask 
 * @Package :com.tkc.converter 
 * @File :DOOConvertToInfo.java 
 * @ClassName: DOOConvertToInfo  
 * 
 * @author tankaichao 
 * @email cgztkc@126.com 
 * @Date 2016年8月9日下午6:04:44
 * @since JDK 1.8 
 *
 */
public class DOOConvertToInfo {

	public static TeacherInfo convertFromTeacherDOOToTeacherInfo(TeacherDOO teacherDOO) {
		TeacherInfo teacherInfo = new TeacherInfo();
		teacherInfo.setId(teacherDOO.getId());
		teacherInfo.setName(teacherDOO.getName());
		teacherInfo.setPassword(teacherDOO.getPassword());
		teacherInfo.setSex(teacherDOO.getSex());
		teacherInfo.setDesc(teacherDOO.getDesc());
		teacherInfo.setPicUrl(teacherDOO.getPicUrl());
		teacherInfo.setSchoolName(teacherDOO.getSchoolName());
		teacherInfo.setRegistDate(TimeHelperUtil.gettimestampToString(teacherDOO.getRegistDate()));
		teacherInfo.setRemark(teacherDOO.getRemark());
		return teacherInfo;
	}
	
	public static List<TeacherInfo> convertFromTeacherDOOsToTeacherInfos(List<TeacherDOO> teacherDOOs) {
		List<TeacherInfo> teacherInfos = new ArrayList<TeacherInfo>();
		for (TeacherDOO teacherDOO : teacherDOOs) {
			TeacherInfo teacherInfo = DOOConvertToInfo.convertFromTeacherDOOToTeacherInfo(teacherDOO);
			teacherInfos.add(teacherInfo);
		}
		return teacherInfos;
	}

}
